function JobsSearch (){

//    $("#keyword").focus(function(){
//        $(this).css("outline","none");
//        $("#searchsort").show().stop(true,false).animate({"width" : "66px"},200);
//    });
//
//    $(document).click(function(evt){
//        if($(evt.target).attr("id") == "searchsort" || $(evt.target).attr("id") == "keyword"  || $(evt.target).closest("#searchsort").length > 0){
//            $("#searchsort").show();
//        }else{
//            $("#searchsort").stop(true,false).animate({"width":"0px"},500,function(){
//                $(this).css("overflow","hidden");
//                $(this).hide();
//            });
//        }
//    });

    $("#jobs_searchsort").hover(function(){
        $(this).css("overflow","visible");
        $(".searchsortlist").show();
    },function(){
        $(this).css("overflow","hidden");
        $(".searchsortlist").hide();
    });

    $(".searchItem").hover(function(){
        $(this).css({"background-color":"#006959","color":"#fff"}).siblings().css({"background-color":"#fff","color":"#333"})
    });

    $(".searchItem").click(function(){
        var itemName = $(this).html(),kw = $("#jobs_keyword").val();
        $(".selectedsort .itemName").html(itemName);
        if(itemName == '职位'){
            var url = "/company/list?typeid=1&kw=" + kw;
        }else if(itemName == '企业'){
            var url = "/company/list?typeid=2&kw=" + kw;
        }else if(itemName == '课程'){
            var url = "/teaches/list/1?kw=" + kw;
        }else if(itemName == '机构'){
            var url = "/teaches/list/2?kw=" + kw;
        }else if(itemName == '文章'){
        	var url = "/employ/list?kw="+kw;
        }else{
            var url = "/";
        }
        if(kw.length != 0){
            window.location.href = url;
        }
    });

    $("#jobs_searchbtn").click(function(){
        var itemName = $(".itemName").html(),kw = $("#jobs_keyword").val();
        if(itemName == '职位'){
            var url = "/company/list?typeid=1&kw=" + kw;
        }else if(itemName == '企业'){
            var url = "/company/list?typeid=2&kw=" + kw;
        }else if(itemName == '课程'){
            var url = "/teaches/list/1?kw=" + kw;
        }else if(itemName == '机构'){
            var url = "/teaches/list/2?kw=" + kw;
        }else if(itemName == '文章'){
        	var url = "/employ/list?kw="+kw;
        }else{
            var url = "/";
        }
        window.location.href = url;
        return false;
    });

    $("#jobs_keyword").keydown(function(e){
        var e = e || event,
            keycode = e.which || e.keyCode || e.charCode;
        if (keycode==13) {
            var itemName = $(".itemName").html(),kw = $("#jobs_keyword").val();
            if(itemName == '职位'){
                var url = "/company/list?typeid=1&kw=" + kw;
            }else if(itemName == '企业'){
                var url = "/company/list?typeid=2&kw=" + kw;
            }else if(itemName == '课程'){
                var url = "/teaches/list/1?kw=" + kw;
            }else if(itemName == '机构'){
                var url = "/teaches/list/2?kw=" + kw;
            }else if(itemName == '文章'){
            	var url = "/employ/list?kw="+kw;
            }else{
                var url = "/";
            }
            window.location.href = url;
            return false;
        }
    });


    $("#com-lists-keyword").keydown(function(e){
        var e = e || event,
            keycode = e.which || e.keyCode || e.charCode;
        if (keycode==13) {
            var kw = $("#com-lists-keyword").val(),areaid = $("#com-lists-area").val(),developid = $("#com-lists-develop").val(),typeid = $("#com-lists-type").val(),sort = $("#com-lists-sort").val();
            var url = "/company/list?typeid=2&kw="+kw+"&areaid="+areaid+"&develop="+developid+"&comtype="+typeid+"&sort="+sort;
            window.location.href = url;
            return false;
        }
    });

    $("#com-lists-searchbtn").click(function(){
        var kw = $("#com-lists-keyword").val(),areaid = $("#com-lists-area").val(),developid = $("#com-lists-develop").val(),typeid = $("#com-lists-type").val(),sort = $("#com-lists-sort").val();
        var url = "/company/list?typeid=2&kw="+kw+"&areaid="+areaid+"&develop="+developid+"&comtype="+typeid+"&sort="+sort;
        window.location.href = url;
        return false;
    });


    $("#jobs-lists-keyword").keydown(function(e){
        var e = e || event,
            keycode = e.which || e.keyCode || e.charCode;
        if (keycode==13) {
            var kw = $("#jobs-lists-keyword").val(),areaid = $("#jobs-lists-area").val(),gzxz = $("#jobs-lists-gzxz").val(),developid = $("#jobs-lists-develop").val(),typeid = $("#jobs-lists-type").val(),gznx = $("#jobs-lists-gznx").val(),degree = $("#jobs-lists-degree").val(),sort = $("#jobs-lists-sort").val();
            var url = "/company/list?typeid=1&kw="+kw+"&areaid="+areaid+"&gzxz="+gzxz+"&develop="+developid+"&comtype="+typeid+"&gznx="+gznx+"&degree="+degree+"&sort="+sort;
            window.location.href = url;
            return false;
        }
    });

    $("#jobs-lists-searchbtn").click(function(){
        var kw = $("#jobs-lists-keyword").val(),areaid = $("#jobs-lists-area").val(),gzxz = $("#jobs-lists-gzxz").val(),developid = $("#jobs-lists-develop").val(),typeid = $("#jobs-lists-type").val(),gznx = $("#jobs-lists-gznx").val(),degree = $("#jobs-lists-degree").val(),sort = $("#jobs-lists-sort").val();
        var url = "/company/list?typeid=1&kw="+kw+"&areaid="+areaid+"&gzxz="+gzxz+"&develop="+developid+"&comtype="+typeid+"&gznx="+gznx+"&degree="+degree+"&sort="+sort;
        window.location.href = url;
        return false;
    });

    $("#teaches_keyword").keydown(function(e){
        var e = e || event,
            keycode = e.which || e.keyCode || e.charCode;
        if (keycode==13) {
            var kw = $("#teaches_keyword").val();
            var url = "/teaches/list/1?kw="+kw;
            window.location.href = url;
            return false;
        }
    });

    $("#teaches_searchbtn").click(function(){
        var kw = $("#teaches_keyword").val();
        var url = "/teaches/list/1?kw=" + kw;
        window.location.href = url;
        return false;
    });


    $("#employ_keyword").keydown(function (e) {
        var e = e || event,
            keycode = e.which || e.keyCode || e.charCode;
        if (keycode == 13) {
            var kw = $("#employ_keyword").val();
            var url = "/employ/list?kw=" + kw;
            window.location.href = url;
            return false;
        }
    });

    $("#employ_searchbtn").click(function () {
        var kw = $("#employ_keyword").val();
        var url = "/employ/list?kw=" + kw;
        window.location.href = url;
        return false;
    });
}